﻿using System.Collections.Generic;

namespace MefContrib.Models.Provider
{
    using System;
    using System.Collections.ObjectModel;

    /// <summary>
    /// Defines an abstract description of an import.
    /// </summary>
    public class ImportDescription
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ImportDescription"/> class.
        /// </summary>
        public ImportDescription()
        {
        }

        /// <summary>
        /// Gets or sets a value indicating whether or not default values are allowed.
        /// </summary>
        /// <value><see langword="true" /> if a default value is allowed; otherwise <see langword="false" />.</value>
        public bool AllowDefault { get; set; }

        /// <summary>
        /// Gets or sets the name of the contact.
        /// </summary>
        /// <value>A <see cref="String"/> containing the name of the contract.</value>
        public string ContractName { get; set; }

        /// <summary>
        /// Gets or sets the type of the contract.
        /// </summary>
        public Type ContractType { get; set; }

        /// <summary>
        /// Gets or sets the name of the import.
        /// </summary>
        /// <value>A <see cref="String"/> containing the name of the member.</value>
        public string MemberName { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the import definition is required to be 
        /// satisfied before a part can start producing exported objects.
        /// </summary>
        /// <value>
        /// <see langword="true"/> if the <see cref="ProviderImportDefinition"/> is required to be 
        /// satisfied before a <see cref="ProviderComposablePart"/> can start producing exported 
        /// objects; otherwise, <see langword="false"/>.
        /// </value>
        public bool Prerequisite { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the import definition can be satisfied multiple times.
        /// </summary>
        /// <value>
        /// <see langword="true"/> if the <see cref="ProviderImportDefinition"/> can be satisfied 
        /// multiple times throughout the lifetime of a <see cref="ProviderComposablePart"/>, otherwise, 
        /// <see langword="false"/>.
        /// </value>
        public bool Recomposable { get; set; }

        /// <summary>
        /// Gets or sets a list of metadata names that the import needs to satisfy.
        /// </summary>
        /// <value>A <see cref="Collection{T}"/> object.</value>
        public ICollection<string> RequiredMetadata { get; set; }
    }
}